-
Notifications
You must be signed in to change notification settings - Fork 15
Add CloudWatch proxy tests #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
9d6626b to
d3bb061
Compare
nik-localstack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with two questions:
-
It seems that the agent didn't catch the instructions added about identifying read-only operations as there are for example BatchGetServiceLevelObjectiveBudgetReport or FilterLogEvents. Should we modify the instructions ?
-
Do we want to release a new version of the extension with these changes ?
Great catch - thanks for the detailed review @nik-localstack ! 🙌 This actually still dates back to the time before we extended the AGENT.md instructions (PR has been in draft state for a while), will ask the agent to update/extend the tests based on this. 👍
Good point - I have another set of tests and small logic changes coming up in #119, perhaps it could make sense to release a new version once that one is reviewed&merged. 👍 |
- Add test file with tests for CloudWatch Metrics and CloudWatch Logs - Fix service name mapping (monitoring -> cloudwatch) in auth_proxy and forwarder - Use botocore service model for protocol compatibility (LocalStack uses smithy-rpc-v2-cbor, boto3 uses query protocol) - Implement resource name matching for CloudWatch and CloudWatch Logs Tests added: - test_cloudwatch_metric_operations: PutMetricData and ListMetrics - test_cloudwatch_alarm_operations: PutMetricAlarm and DescribeAlarms - test_cloudwatch_readonly_operations (xfail): read-only mode - test_cloudwatch_resource_name_matching (xfail): resource pattern matching - test_logs_group_operations: CreateLogGroup and DescribeLogGroups - test_logs_stream_and_events: log streams and events - test_logs_readonly_operations: read-only mode for logs - test_logs_resource_name_matching: resource pattern matching for logs - test_logs_filter_log_events: FilterLogEvents operation Known limitations (2 xfail tests): - CloudWatch read_only and resource_name_matching: form data stream consumed by LocalStack before proxy can access it (Query protocol issue) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add DELETE endpoint to remove proxies from PROXY_INSTANCES - Add deregister_from_instance() method in auth_proxy.py - Update test fixture to deregister proxies during cleanup - Remove xfail markers from CloudWatch tests that now pass - Add _reconstruct_request_body for Query protocol services - Add resource name matching for CloudWatch and CloudWatch Logs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d3bb061 to
dbd3e14
Compare
- Add test_logs_readonly_filter_log_events to verify FilterLogEvents works in read_only mode - Add test_logs_readonly_insights_query to verify StartQuery/GetQueryResults work in read_only mode - Update AGENTS.md with instruction to avoid time.sleep() in tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add proxy tests for the CloudWatch service (metrics + logs)
Tests added: